/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pbl;

import java.net.*;
import java.io.*;

/**
 * @author pbl
 *
 */
public class SimpleTcpClient {
  public static void main (String args[]) throws Exception{
    InetAddress serverAddress = InetAddress.getByName("localhost");
    int serverPort = 7896;
    String message = "hey hey hey";
    Boolean toUpperCase = true;
    
    Socket socket = new Socket( serverAddress, serverPort );
    OutputStream os = socket.getOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream( os );
    
    oos.writeObject(toUpperCase);
    oos.writeObject( message );
    
    InputStream is = socket.getInputStream();
    ObjectInputStream ois = new ObjectInputStream( is );
    String response = (String) ois.readObject();
    
    System.out.println( response );
    
    
    
		//socket.close();
  }	
}